package com.bleeth.fx.helper;

import cn.hutool.core.util.StrUtil;

/**
 * @author BleethNie
 * @version 1.0
 * @date 2021-12-24 9:37
 **/
public enum ThemeTypeEnum {
    DEFAULT_COLOR("DEFAULT", "#ECF5FF"),
    PRIMARY_COLOR("PRIMARY", "#409EFF"),
    SUCCESS_COLOR("SUCCESS", "#67C23A"),
    WARNING_COLOR("WARNING", "#E6A23C"),
    INFO_COLOR("INFO", "#909399"),
    DANGER_COLOR("DANGER", "#F56C6C"),
    WHITE_COLOR("WHITE", "#FFFFFF"),
    BLACK_COLOR("BLACK", "#000000"),
    DEFAULT_FONT_COLOR("DEFAULT_FONT_COLOR", "#303133"),
    TRANSPARENT_FONT_COLOR("TRANSPARENT_FONT_COLOR", "transparent");


    private String value;

    private String name;

    ThemeTypeEnum(String name, String value) {
        this.value = value;
        this.name = name;
    }


    public static ThemeTypeEnum getMatched(String name) {
        ThemeTypeEnum themeTypeEnum = getMatchedNull(name);
        if (themeTypeEnum != null) {
            return themeTypeEnum;
        }
        throw new RuntimeException("");
    }

    public static ThemeTypeEnum getMatchedNull(String name) {
        for (ThemeTypeEnum item : ThemeTypeEnum.values()) {
            if (StrUtil.equalsIgnoreCase(item.getName(), name)) {
                return item;
            }
        }
        return null;
    }


    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }
}
